/*
 * DbExecption.h
 *
 *  Created on: 2018年1月3日
 *      Author: chuanjiang.zh@qq.com
 */

#ifndef DBEXECPTION_H_
#define DBEXECPTION_H_

#include "DbType.h"
#include "SociType.h"


namespace soci
{

    namespace mysql
    {
        enum ErrorCode
        {
            kDisconneted = 2013,
            kNotConnected = 2002
        };
    }

    class mysql_soci_error : public soci::soci_error
    {
    public:
        mysql_soci_error(std::string const & msg, int errNum)
            : soci_error(msg), err_num_(errNum) {}

        unsigned int err_num_;
    };


    namespace oracle
    {
        enum ErrorCode
        {
            kDisconneted = 3135,
            kNotConnected = 3114
        };
    }

    class oracle_soci_error : public soci::soci_error
    {
    public:
        oracle_soci_error(std::string const & msg, int errNum = 0);

        int err_num_;
    };



} /* namespace db */

#endif /* DBEXECPTION_H_ */
